//----------------------- Output Registers, physical pins
#define PORT_BU1	PORTK
#define PORT_BU2	PORTA

#define PORT_LADR	PORTA
#define PORT_HADR	PORTK

#define ADDRESS_OE	outb(DDRA, 0xFF); outb(DDRK, 0xFF)
#define ADDRESS_OD	outb(DDRA, 0x00); outb(DDRK, 0x00)

// Sets the Address given x y z byte values
//#define PORT_ADR_SET (z,y,x)	outb(PORT_LADR, x); \ outb(PORT_MADR, y); \ outb(PORT_HADR, inb(PORT_HADR ~ADRMSK_HADR | (z & 0x07)))
#define PORT_ADR_SET_H(x)	outb(PORT_HADR, x)
#define PORT_ADR_SET_L(x)	outb(PORT_LADR, x)
#define ADDRESS(x)			PORT_ADR_SET_H((x)>>8); PORT_ADR_SET_L((x))

#define PORT_DUT_EN	PORTG, PG2
#define PORT_OE1	PORTG, PG0
#define PORT_OE2	PORTG, PG1
#define PORT_LE		PORTD, PD7
#define PORT_CE		PORTD, PD6

//----------------------- Data Direction Registers

#define DDR_DUT_EN	DDRG, PG2
#define DDR_OE1		DDRG, PG0
#define DDR_OE2		DDRG, PG1
#define DDR_LE		DDRD, PD7
#define DDR_CE		DDRD, PD6

#define DDR_BU1		DDRC
#define DDR_BU2		DDRJ

//----------------------- Input Registers
#define PIN_BU1		PINC
#define PIN_BU2		PINJ

#define UDRE UDRE0	// Same position/name for Atmega1280
#define ADCSR ADCSRA

#ifndef ADC_INITIAL_REF
#define ADC_INITIAL_REF AREF
#endif

#define ADC_AUX1	3
#define ADC_AUX2	2
#define ADC_AUX3	1
#define ADC_AUX4	0
#define ADC_VREF	4

#define TIMERCOUNT	10
